
/**
 * 通用的plupload创建放方法
 * return plupload 实例
 */
function createPlupload(buttonDom,moduleType,uploadedCallback){
	//实例化一个plupload上传对象
	var uploader = new plupload.Uploader({ 
    	browse_button : buttonDom,
    	url : appServer + '/common/image/upload.htm',
		multipart_params : {moduleType:moduleType},
    	flash_swf_url : appServer + '/scripts/plupload/Moxie.swf',
    	silverlight_xap_url :  appServer + '/scripts/plupload/Moxie.xap',
    	filters: {
    	  mime_types : [{
    				title : "Image files",
    				extensions : "jpg,jpeg,gif,png"
    			}],
    	  max_file_size : '5MB', //最大只能上传100kb的文件
    	  prevent_duplicates : false //不允许队列中存在重复文件
    	}
    });
    uploader.init(); //初始化
	
	//绑定文件添加进队列事件
	uploader.bind('FilesAdded',function(uploader,files){
		uploader.start();
	});
	
	uploader.bind('FileUploaded',function(uploader,files,data){
		if(uploadedCallback) uploadedCallback(data);
	});
	
	return uploader;
}